package Stringlei;

import java.util.Scanner;

public class Stringwork2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入字符");
        String str = sc.next();
        int[] num = statics(str);
        for (int i = 0; i < num.length; i++) {
            System.out.println(num[i]);
        }
    }
    public static int[] statics(String str)
    {
        int[] num = {0,0,0,0};
        for (int i = 0; i < str.length(); i++) {
            if(str.charAt(i)<='z'&&str.charAt(i)>='a')
            {
                num[0]++;
            }
            else if (str.charAt(i)<='Z'&&str.charAt(i)>='A')
            {
                num[1]++;
            }
            else if(str.charAt(i)<='9'&&str.charAt(i)>='0')
            {
                num[2]++;
            }
            else
            {
                num[3]++;
            }
        }
        return num;
    }
}
